package com.lwm.controller;

import com.github.pagehelper.PageInfo;
import com.lwm.domain.PurchaseApproval;
import com.lwm.domain.ReplenishmentApproval;
import com.lwm.domain.ResponseResult;
import com.lwm.dto.PageParams;
import com.lwm.service.ReplenishmentApprovalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;



/**
 * 补货申请表(ReplenishmentApproval)表控制层
 *
 * @author lzl
 * @since 2023-10-17 18:11:11
 */
@RestController
@RequestMapping("replenishmentApproval")
public class ReplenishmentApprovalController {
    /**
     * 服务对象
     */
    @Autowired
    private ReplenishmentApprovalService replenishmentApprovalService;

    @GetMapping("{id}")
    public ResponseResult<ReplenishmentApproval> getById(@PathVariable Long id) {
        return replenishmentApprovalService.getById(id);
    }

    @GetMapping("/page")
    public ResponseResult<PageInfo<ReplenishmentApproval>> page(ReplenishmentApproval replenishmentApproval, PageParams pageParams) {
        return replenishmentApprovalService.page(replenishmentApproval, pageParams);
    }

    @PutMapping
    public ResponseResult update(@RequestBody ReplenishmentApproval replenishmentApproval) {
        return replenishmentApprovalService.update(replenishmentApproval);
    }

}

